<?php

class Ialbum_Widget_TopPosterController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
	$tblAlbum =  Engine_Api::_()->getDbTable('albums', 'album');
	$select = $tblAlbum->select()
						->group('owner_id')
						->order('count(owner_id) DESC');
	
    $this->view->people = $people = Zend_Paginator::factory($select);
    $people->setItemCountPerPage($this->_getParam('itemCountPerPage', 10));  
    $count = $people->count();
    if ($count <= 0) {
      return $this->setNoRender();
    }
  }
}
